import 'package:flutter/cupertino.dart';

class SliverPersistentDelegate extends SliverPersistentHeaderDelegate {
  final Widget child;
  final double height;

  const SliverPersistentDelegate({
    @required this.child,
    @required this.height,
  }) : assert(child != null);

  @override
  Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
    return child;
  }

  @override
  bool shouldRebuild(SliverPersistentDelegate oldDelegate) {
    return false;
  }

  @override
  double get maxExtent => height;

  @override
  double get minExtent => height;
}
